A utility for checking the validity of credit card numbers.
This version by Peter Marks.
Type in the number and press return or enter to check it. Beeps if bad. Also displays the type of card including: Amex, Mastercard, Visa, Diners, Australian BankCard & Discover.
Based on the algorithm presented in Check Numbers 1.0 by René G. A. Ros who says:
“FileMaker Pro 3.0 example scripts to check the validity of Credit Card, EAN and of ISBN codes.
Ported to FileMaker Pro 3.0 by René G.A. Ros (rgaros@bio.vu.nl)
Based on earlier ports to 4th Dimension by the same author. This 4D code was based on, and extended because of, information made available on the Internet by Diomidis Spinellis (dds@doc.ic.ac.uk), Peter Rukavina (peter@crafs-council.pe.ca) and Florian Dejako (fdj@muc.de).
Try to get it into calculation fields!”
This version of the algorithm has been put into a c++ program based on the Metrowerks PowerPlant “Dashboard” sample.
Here are the two interesting methods, (note that I use the string library class that comes with PowerPlant):
// work out the card type by looking at first and second digits
• AppleScript API to allow it to check numbers for other programs, although it’s probably better to just convert the algorithm (which I’ve provided above) and put it in the client program.
Notes
The program creates a small prefs file (317 bytes) in your preference folder that holds the last number you had in the window and also the window position.